import os
import time
import numpy as np
import sys
from utils.gantt_plot import schedule_gantt

# from core.config import WorkerConfig,PlaneConfig

from static_play.first_fit import FirstFitAlgorithm
from static_play.utils.csv_reader import CSVReader
from static_play.utils.episode import Episode

workers_configs = CSVReader.get_worker_configs(r'.\static_play\board_files\workers.csv')
planes_configs = CSVReader.get_plane_configs(r'.\static_play\board_files\planes.csv')
print("config finished")
tic = time.time()

algorithm = FirstFitAlgorithm()


episode = Episode(workers_configs, planes_configs, algorithm)

episode.run()

print(episode.env.now, time.time() - tic)
gant_df = episode.log_gantt()
# print(gant_df)
color_map = schedule_gantt(gant_df)
print(color_map)

